(function() {
    'use strict';

    /**
     * @ngdoc function
     * @name webApp.controller:UserCtrl
     * @description
     * # UserCtrl
     * Controller of the webApp
     */
    angular.module('webApp')
        .controller('UserCtrl', UserCtrl);

    UserCtrl.$inject = ['$scope', 'dataService', 'helper', '$location', '$rootScope'];

    function UserCtrl($scope, dataService, helper, $location, $rootScope) {

        $scope.listAction = function() {
            $scope.pageSize = 10;
            $scope.getList();
        }

        //获取列表
        $scope.getList = function(pageNo) {
            $scope.pageNo = pageNo || 1;
            var query = {
                page_no: $scope.pageNo,
                page_size: $scope.pageSize,
                query: {
                    inviter_id:$rootScope.currentUser.user_id
                },  
            };
            dataService.memberGet(query,'null').then(function(list) {
                if (list && list.wx_members) {
                    $scope.user_list = list.wx_members;
                    $scope.total_count = list.total_count;
                }
            });
        }



    }
})();